/*
2021-7-13
https://ac.nowcoder.com/acm/contest/17942/G
*/

#include<iostream>

using namespace std;

int days[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

int leap(int year)
{
    return (year%4==0&&year%100!=0)||year%400==0;
}

int main()
{
    int y=2000,m=1,d=1;
    int ans=0;
    int week=6;
    for(y=2000;y<2025;y++)
    {
        for(m=1;m<13;m++)
        {
            int maxd=days[m];
            if(m==2) maxd=days[m]+leap(y);
            for(d=1;d<=maxd;d++)
            {
                if(d==1 || week==1) ans+=2;
                else ans+=1;
                week=(week+1)%7;
                if(y==2020 && m==10 && d==1)
                {
                    cout<<ans<<endl;
                    return 0;
                }
            }
        }
    }
    return 0;
}
